home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / getdest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  658 b   |  31 lines

  1. /*
  2. \funcref{getdest}{VAR\_ $*$getdest ()}
  3.     {}
  4.     {pointer to {\em VAR\_} structure}
  5.     {getint16()}
  6.     {}
  7.     {getdest.c}
  8.     {
  9.  
  10.         This function is called when an opcode is read which is followed by a
  11.         variable number (e.g., {\em op\_push\_var}). The index is read and a
  12.         pointer to a {\em VAR\_} structure is returned; either in the variables
  13.         section or in the stack (relative to {\em bp}).
  14.  
  15.     }
  16. */
  17.  
  18. #include "icm-exec.h"
  19.  
  20. VAR_ *getdest ()
  21. {
  22.     register INT16
  23.         index;
  24.  
  25.     index = getint16 (infile);
  26.     if ((UNS16)index < 0x8000)
  27.         return (var + index);
  28.  
  29.     return (stack + bp + (INT16)0xc000 - index);
  30. }
  31.